<?php
/*
simplicity of use
simplicity of design
*/


include'plugin/geist/verify.php';
//include'php/mysqli.php';
//include'php/io/s2file.php';
//include'php/net/ip.php';
//include'php/ml.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>


<?php $clock=microtime();

/* Hi Sitegeist - Base cookie read /  * Used to create db connection. */
//session_start();
//$_SESSION['db']=
function cookieExists(){
  if(isset($_COOKIE['sitegeistconfig2']))return true; else return false; 
    }
/*function readCookie(){ return explode(";", $_COOKIE['sitegeistconfig2']); }
//check if cookie exists / creates a mysql database connection object. 
if (cookieExists()){
  list($host,$dbase,$uname,$passw)=readCookie();
  mysql_connect($host,$uname,$passw) or die(mysql_error());
  mysql_select_db($dbase) or die(mysql_error());
}*/
$hisite=$_GET['site'];
$plugin=$_GET['plugin'];
$page=$_GET['page'];
?>
  

<link rel="shortcut icon" href="../res/sitegeist.gif"/>
<link rel="stylesheet" type="text/css" href=".styled/styled.css" media="all"/>


</head><body><div id="sg">


        <div class="nav" id="sgup">
Welcome, <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=users"><?php echo$_SESSION['user']; ?></a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=base">CMS</a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=plugin">Plugins</a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=styled&page=styled">Styled</a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=config">Configuration</a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=import">Import</a>
 <a href="index2.php?site=',<?php $hisite ?>,'&plugin=base&page=export">Export</a>
 <img src="../res/sitegeist.gif" alt="sg"/>
 <?php echo"site: <b>$hisite</b> plugin: <b>$plugin</b> page: <b>$page</b>";
 echo' [ ', getcwd() ?> ]
<br/></div>


<div class="aside" id="sgleft"><?php
$path='plugin/'; /*plugin menu*/
if($handle=@opendir($path)){
  while(false!==($file=@readdir($handle))){
    if(substr($file,0,1)!='.' && @is_dir($path.$file) && $subhandle=@opendir($path.$file)){
      $subdirs=array(); /*if plugin/$file is a visible directory*/
      while(false!==($sub=@readdir($subhandle))){
          //todo: remove .svn condition
        if(substr($sub,0,1)=='.' && $sub!='.' && $sub!='..' && $sub!='.'.$file && $sub!='.svn' && @is_dir($path.$file.'/'.$sub)){
          $sub=substr($sub, 1); /*if plugin/$file/$sub is a hidden directory but not .svn*/
          $subdirs[]="~~~~<a href=\"index2.php?site=$hisite&plugin=$file&page=$sub\">$sub</a>";
        }
      }
      closedir($subhandle);
      echo"<a href=\"index2.php?site=$hisite&plugin=$file&page=$file\">~~$file~~</a><br />",
      implode('<br />',$subdirs),"<br/><br/>";
    }
  }
  closedir($handle);
}
?></div>

<script type="text/javascript">//<![CDATA[
<?php 
include'js/ajax/ajaxjs.js';
include'plugin/base/.page/goto.js';
?>
//]]></script>


<div id="sgmain"><?php include"plugin/$plugin/.$page/0.php"; ?></div>


<div id="footer">
<h5> <del>&copy;</del> 2011 Jeffrey Geyssens - Marnix T'Jaeckx</h5>
<h5>
Public Domain / No Copyright<br />
<?php echo 'Pageload: ',microtime() - $clock,' secs <br /> '; ?>
</h5>
</div>
</div>


</body></html>